#pragma once
#ifndef RAYDATA_H
#define RAYDATA_H

#include "DScommon.h"

namespace OBR
{
struct RayData
{
    float3 o, d;
    float t, tmin = 1e-5, tmax = 1e10;
    /* ---------------------------- differentials --------------------------- */
    bool has_differential = false;
    float3 rx_o, ry_o, rx_d, ry_d;
    /* ----------------------------- medium info ---------------------------- */
    int med_id = -1;
    int med_instance_id;
    /* ------------------------------ debug use ----------------------------- */
    __forceinline__ __device__ void print()
    {
        printf("---------------------Ray Data---------------------\n");
        printf("orig: [%8.6f, %8.6f, %8.6f]\n", o.x, o.y, o.z);
        printf("dir:  [%8.6f, %8.6f, %8.6f]\n", d.x, d.y, d.z);
        printf("t: %8.6f, tmin: %8.6f, tmax: %8.6f\n", t, tmin, tmax);
        printf("medium: %d - %d\n", med_id, med_instance_id);
        printf("--------------------------------------------------\n");
    }
};
} // namespace OBR

#endif
